package edu.csl.study.springboot.core.user.service.impl;

import edu.csl.study.springboot.core.user.entity.User;
import edu.csl.study.springboot.core.user.mapper.UserMapper;
import edu.csl.study.springboot.core.user.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 自动生成代码
 * @since 2021-09-26
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
    @Cacheable(value = "user",key = "#id")
    public User getMyUser( Long id){
        User user =  new User();
        user.setName("zhangsan");
        user.setId(2l);
        System.out.println("-------------444444444444444------------");
        return user;
    }
    @Cacheable(value = "user2")
    public User getMyUser2( Long id){
        User user =  new User();
        user.setName("zhangsan");
        user.setId(2l);
        System.out.println("-------------444444444444444------------");
        return user;
    }
}
